<html>
<head><meta charset="utf-8"><title>x.py + download-ci-llvm -&gt; explicit python3 needed? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html">x.py + download-ci-llvm -&gt; explicit python3 needed?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221398907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221398907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221398907">(Jan 02 2021 at 12:55)</a>:</h4>
<p>I just got this error:</p>
<div class="codehilite"><pre><span></span><code>$ ./x.py check
extracting /home/r/src/rust/rustc.3/build/cache/2020-12-30/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz
extracting /home/r/src/rust/rustc.3/build/cache/2020-12-30/rustc-beta-x86_64-unknown-linux-gnu.tar.gz
extracting /home/r/src/rust/rustc.3/build/cache/2020-12-30/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
extracting /home/r/src/rust/rustc.3/build/cache/2020-11-19/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz
error: XZ support is required to download LLVM
help: consider disabling `download-ci-llvm` or using python3
</code></pre></div>
<p>Looks like I now need to explicitly prefix <code>python3</code> for every single <code>x.py</code> invocation? That seems... rather suboptimal.^^<br>
Cc <span class="user-mention" data-user-id="232545">@Joshua Nelson</span></p>



<a name="221398923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221398923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221398923">(Jan 02 2021 at 12:55)</a>:</h4>
<p>See <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/download-ci-llvm.20is.20broken.20again">https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/download-ci-llvm.20is.20broken.20again</a></p>



<a name="221401231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221401231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221401231">(Jan 02 2021 at 14:04)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> the GZ artifacts aren't stored on s3 anymore</p>



<a name="221401241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221401241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221401241">(Jan 02 2021 at 14:05)</a>:</h4>
<p>If you find a way to download xz with python 2 do let me know</p>



<a name="221401255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221401255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221401255">(Jan 02 2021 at 14:05)</a>:</h4>
<p>at least on Linux that should be easy by using <code>curl</code>+<code>tar</code> -- no idea about other OSes though</p>



<a name="221401301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221401301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221401301">(Jan 02 2021 at 14:06)</a>:</h4>
<p>See also <a href="https://github.com/rust-lang/rust/pull/80585">https://github.com/rust-lang/rust/pull/80585</a>, which went badly</p>



<a name="221401322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221401322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221401322">(Jan 02 2021 at 14:07)</a>:</h4>
<blockquote>
<p>at least on Linux that should be easy by using <code>curl</code>+<code>tar</code> -- no idea about other OSes though</p>
</blockquote>
<p>Well right, that's exactly what went wrong in 80585 - the second you depend on a shell everything is non portable</p>



<a name="221402811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221402811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221402811">(Jan 02 2021 at 14:49)</a>:</h4>
<p>FWIW if you're on debian/ubuntu you can fix this with <code>sudo apt install python-is-python3</code></p>



<a name="221407491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221407491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221407491">(Jan 02 2021 at 17:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221401301">said</a>:</p>
<blockquote>
<p>See also <a href="https://github.com/rust-lang/rust/pull/80585">https://github.com/rust-lang/rust/pull/80585</a>, which went badly</p>
</blockquote>
<p>yeah I saw that. a really cute hack though :D</p>



<a name="221407541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221407541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221407541">(Jan 02 2021 at 17:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221402811">said</a>:</p>
<blockquote>
<p>FWIW if you're on debian/ubuntu you can fix this with <code>sudo apt install python-is-python3</code></p>
</blockquote>
<p>"fix" as in "make everything else on my system explode, but x.py will work"? <span aria-label="rolling on the floor laughing" class="emoji emoji-1f923" role="img" title="rolling on the floor laughing">:rolling_on_the_floor_laughing:</span></p>



<a name="221407556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221407556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221407556">(Jan 02 2021 at 17:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221401322">said</a>:</p>
<blockquote>
<blockquote>
<p>at least on Linux that should be easy by using <code>curl</code>+<code>tar</code> -- no idea about other OSes though</p>
</blockquote>
<p>Well right, that's exactly what went wrong in 80585 - the second you depend on a shell everything is non portable</p>
</blockquote>
<p>you don't have to depend on a shell to call <code>curl</code>+<code>tar</code> from python, though.</p>



<a name="221407636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221407636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221407636">(Jan 02 2021 at 17:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221407556">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221401322">said</a>:</p>
<blockquote>
<blockquote>
<p>at least on Linux that should be easy by using <code>curl</code>+<code>tar</code> -- no idea about other OSes though</p>
</blockquote>
<p>Well right, that's exactly what went wrong in 80585 - the second you depend on a shell everything is non portable</p>
</blockquote>
<p>you don't have to depend on a shell to call <code>curl</code>+<code>tar</code> from python, though.</p>
</blockquote>
<p>well, people don't have tar installed on windows though</p>



<a name="221408142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221408142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221408142">(Jan 02 2021 at 17:16)</a>:</h4>
<p>sure, but they'll probably have <code>python</code> being Python 3, right?</p>



<a name="221408149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221408149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221408149">(Jan 02 2021 at 17:16)</a>:</h4>
<p>so if <code>tar</code> is just the fallback in case python doesn't support <code>gz</code>, that could still help</p>



<a name="221408207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221408207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221408207">(Jan 02 2021 at 17:18)</a>:</h4>
<p>hmm, that could work</p>



<a name="221410558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410558">(Jan 02 2021 at 18:15)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> Do you have Python 3 installed? Not as "python" obviously, but do python3?</p>



<a name="221410631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410631">(Jan 02 2021 at 18:17)</a>:</h4>
<p>We could run x.py using "python" and use python (rather than shell) to figure out if we can then re-execute it using Python 3.</p>



<a name="221410639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410639">(Jan 02 2021 at 18:18)</a>:</h4>
<p>oh boy</p>



<a name="221410676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410676">(Jan 02 2021 at 18:18)</a>:</h4>
<p>that could work, yeah</p>



<a name="221410677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410677">(Jan 02 2021 at 18:18)</a>:</h4>
<p>That's just a PATH search. Shouldn't be <em>that</em> hard.</p>



<a name="221410706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410706">(Jan 02 2021 at 18:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221410558">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> Do you have Python 3 installed? Not as "python" obviously, but do python3?</p>
</blockquote>
<p>yes. <code>python3 ./x.py</code> is what I currently do when it complains.</p>



<a name="221410707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410707">(Jan 02 2021 at 18:19)</a>:</h4>
<p>As another option, we could change x.py to use "python3" in its shebang, and tell people who don't have python3 to edit it if they have to...</p>



<a name="221410715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410715">(Jan 02 2021 at 18:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221410707">said</a>:</p>
<blockquote>
<p>As another option, we could change x.py to use "python3" in its shebang, and tell people who don't have python3 to edit it if they have to...</p>
</blockquote>
<p>that was tried before. it fails on Windows where it seems the python 3 installer installs <code>python.exe</code>.</p>



<a name="221410718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410718">(Jan 02 2021 at 18:19)</a>:</h4>
<p>there's <code>shutil.which</code> but that only works in python3 <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="221410766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410766">(Jan 02 2021 at 18:20)</a>:</h4>
<p>I can just rewrite it, it's like 10 lines</p>



<a name="221410767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410767">(Jan 02 2021 at 18:20)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> insert screaming here...</p>



<a name="221410770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410770">(Jan 02 2021 at 18:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221410767">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> insert screaming here...</p>
</blockquote>
<p>yeah, I feel you</p>



<a name="221410779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410779">(Jan 02 2021 at 18:20)</a>:</h4>
<p>"python" should always be python 2, or not exist.</p>



<a name="221410786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410786">(Jan 02 2021 at 18:21)</a>:</h4>
<p>it is in <code>distutils</code> but that is a rabbit hole I am <em>not</em> willing to go down</p>



<a name="221410798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410798">(Jan 02 2021 at 18:21)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Yeah. Just detect if you're in python 3, and if not, manually search PATH.</p>



<a name="221410849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410849">(Jan 02 2021 at 18:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221410779">said</a>:</p>
<blockquote>
<p>"python" should always be python 2, or not exist.</p>
</blockquote>
<p>sadly, someone decided otherwise. <code>apt install python-is-python3</code> will make <code>python</code> be <code>python3</code> on Debian+derivatives. my impression is that they (They?) decided that "when the transition is done", <code>python</code> should be python 3. why anyone thought that was a good idea is beyond me.</p>



<a name="221410871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410871">(Jan 02 2021 at 18:23)</a>:</h4>
<p>I'm aware, and I agree: that abomination should not exist.</p>



<a name="221410873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410873">(Jan 02 2021 at 18:23)</a>:</h4>
<p>on the plus side, this is yet another aspect in which the python 2-&gt;3 transition is a very useful case study of how <em>not</em> to do this ;)</p>



<a name="221410878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410878">(Jan 02 2021 at 18:23)</a>:</h4>
<p>why not have update-alternatives for python versions?</p>



<a name="221410924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410924">(Jan 02 2021 at 18:24)</a>:</h4>
<p>I wish debian used update-alternatives more, it's so annoying that clang-tidy is 6.0 and I have to say clang-tidy-11 instead</p>



<a name="221410928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410928">(Jan 02 2021 at 18:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221410878">said</a>:</p>
<blockquote>
<p>why not have update-alternatives for python versions?</p>
</blockquote>
<p>python 2 and python 3 are different languages... <code>python</code> should just never be python 3. IMO.</p>



<a name="221410934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410934">(Jan 02 2021 at 18:24)</a>:</h4>
<p>update-atlernatives is for compatible replacements, which this definitely is not^^</p>



<a name="221410939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410939">(Jan 02 2021 at 18:24)</a>:</h4>
<p>well, fair enough</p>



<a name="221410945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410945">(Jan 02 2021 at 18:24)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Because the two are not compatible, and Debian does have a policy against using alternatives for things that aren't compatible.</p>



<a name="221410953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410953">(Jan 02 2021 at 18:25)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Do you already know about os.pathsep?</p>



<a name="221410961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221410961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221410961">(Jan 02 2021 at 18:25)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> I'm just going to <code>try: Popen("python3"); catch: pass</code></p>



<a name="221411028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411028">(Jan 02 2021 at 18:26)</a>:</h4>
<p>Please don't. That'll add the overhead of actually starting python3 to every invocation of x.py.</p>



<a name="221411041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411041">(Jan 02 2021 at 18:26)</a>:</h4>
<p>only if this is python2</p>



<a name="221411052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411052">(Jan 02 2021 at 18:27)</a>:</h4>
<p>(Well, every invocation that's... Yes, that. :) )</p>



<a name="221411064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411064">(Jan 02 2021 at 18:27)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> I'm confused, what could I do instead?</p>



<a name="221411072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411072">(Jan 02 2021 at 18:27)</a>:</h4>
<p>also, bootstrap.py already cares <em>very</em> little about its latency lol</p>



<a name="221411080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411080">(Jan 02 2021 at 18:27)</a>:</h4>
<p>isn't that negiligble given that we're starting python2 first and then python3, i.e. we have at least 2 interpreter startups? <code>python3 --version</code> should be reasonably cheap in comparison</p>



<a name="221411083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411083">(Jan 02 2021 at 18:27)</a>:</h4>
<p>for a while it would run <code>rustup default</code> twice per run and no one noticed</p>



<a name="221411135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411135">(Jan 02 2021 at 18:28)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> that's a good point, actually. It'll only have overhead if you have Python 2 and not Python 3.</p>



<a name="221411151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411151">(Jan 02 2021 at 18:28)</a>:</h4>
<p><em>unnecessary</em> overhead, rather.</p>



<a name="221411154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411154">(Jan 02 2021 at 18:29)</a>:</h4>
<p>then the overhead is whatever it takes to figure out that python 3 does not exist</p>



<a name="221411159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411159">(Jan 02 2021 at 18:29)</a>:</h4>
<p>Then in that case...</p>



<a name="221411160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411160">(Jan 02 2021 at 18:29)</a>:</h4>
<p>which we'd have to pay anyway no matter the fallback mechanism?</p>



<a name="221411233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411233">(Jan 02 2021 at 18:30)</a>:</h4>
<p>Checking something...</p>



<a name="221411310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411310">(Jan 02 2021 at 18:32)</a>:</h4>
<p>ok, this seems to work</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/x.py b/x.py</span>
<span class="gh">index 7973730ef17..8b263954e3e 100755</span>
<span class="gd">--- a/x.py</span>
<span class="gi">+++ b/x.py</span>
<span class="gu">@@ -4,6 +4,17 @@</span>

 import os
 import sys
<span class="gi">+</span>
<span class="gi">+# If this is python2, check if python3 is available and re-execute with that</span>
<span class="gi">+# interpreter.</span>
<span class="gi">+if sys.version_info.major &lt; 3:</span>
<span class="gi">+    import subprocess</span>
<span class="gi">+    try:</span>
<span class="gi">+        exit(subprocess.call(["python3"] + sys.argv))</span>
<span class="gi">+    except OSError:</span>
<span class="gi">+        # Python 3 isn't available, do nothing</span>
<span class="gi">+        pass</span>
<span class="gi">+</span>
</code></pre></div>



<a name="221411332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411332">(Jan 02 2021 at 18:33)</a>:</h4>
<p>yup and that supports XZ :)</p>



<a name="221411408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411408">(Jan 02 2021 at 18:34)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> To answer your earlier question, I was originally expecting that you would getenv PATH (with fallback to os.defpath), split on os.pathsep, and search for python3 in each dir.</p>



<a name="221411412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411412">(Jan 02 2021 at 18:34)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> that breaks if python3 isn't actually executable</p>



<a name="221411415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411415">(Jan 02 2021 at 18:34)</a>:</h4>
<p>better to ask forgiveness than permission and all that</p>



<a name="221411423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411423">(Jan 02 2021 at 18:34)</a>:</h4>
<p>If you have python3 on your path but it isn't executable then you're asking for trouble. :)</p>



<a name="221411428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411428">(Jan 02 2021 at 18:35)</a>:</h4>
<p>well, this handles it for me automatically</p>



<a name="221411439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411439">(Jan 02 2021 at 18:35)</a>:</h4>
<p>That said...</p>



<a name="221411443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411443">(Jan 02 2021 at 18:36)</a>:</h4>
<p>How about, instead of subprocess, calling execvp instead?</p>



<a name="221411486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411486">(Jan 02 2021 at 18:36)</a>:</h4>
<p>that doesn't let me catch the exception and fall back to python2</p>



<a name="221411487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411487">(Jan 02 2021 at 18:36)</a>:</h4>
<p>I really think the overhead is not worth worrying about</p>



<a name="221411490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411490">(Jan 02 2021 at 18:36)</a>:</h4>
<p>If it returns at all, it failed, so keep going with the python  you have.</p>



<a name="221411506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411506">(Jan 02 2021 at 18:37)</a>:</h4>
<p>I agree with going ahead and trying, rather than checking first. I'm just suggesting using exec instead.</p>



<a name="221411507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411507">(Jan 02 2021 at 18:37)</a>:</h4>
<p>I don't see what benefit that has over subprocess?</p>



<a name="221411511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411511">(Jan 02 2021 at 18:37)</a>:</h4>
<p>I'm not even sure execvp is available on windows</p>



<a name="221411515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411515">(Jan 02 2021 at 18:37)</a>:</h4>
<p>if it works, it replaces the current process, rather than creating a separate one and leaving the original around until the separate one finishes.</p>



<a name="221411516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411516">(Jan 02 2021 at 18:37)</a>:</h4>
<p>And yes, it's available on Windows. I just checked.</p>



<a name="221411568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411568">(Jan 02 2021 at 18:38)</a>:</h4>
<p>Is this something we could do onetime as part of <code>x.py setup</code> and then store the result in <code>config.toml</code> so we don't have to do this on every invocation?</p>



<a name="221411575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411575">(Jan 02 2021 at 18:39)</a>:</h4>
<p>I am still confused why everyone is worried so much about overhead</p>



<a name="221411578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411578">(Jan 02 2021 at 18:39)</a>:</h4>
<p>this is <em>maybe</em> a tenth of a second</p>



<a name="221411587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411587">(Jan 02 2021 at 18:39)</a>:</h4>
<div class="codehilite" data-code-language="Python"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>
<span class="k">try</span><span class="p">:</span>
    <span class="n">os</span><span class="o">.</span><span class="n">execvp</span><span class="p">(</span><span class="s2">"python3"</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">args</span><span class="p">)</span>
<span class="n">catch</span><span class="p">:</span>
    <span class="k">pass</span>
</code></pre></div>



<a name="221411638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411638">(Jan 02 2021 at 18:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221411587">said</a>:</p>
<blockquote>
<p><div class="codehilite" data-code-language="Python"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>
<span class="k">try</span><span class="p">:</span>
    <span class="n">os</span><span class="o">.</span><span class="n">execvp</span><span class="p">(</span><span class="s2">"python3"</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">args</span><span class="p">)</span>
<span class="n">catch</span><span class="p">:</span>
    <span class="k">pass</span>
</code></pre></div><br>
</p>
</blockquote>
<p>sure, I'm switching to that now, but I still think if you want to make bootstrap faster there are lots of better places to do it</p>



<a name="221411642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411642">(Jan 02 2021 at 18:40)</a>:</h4>
<p>make rustbuild compile faster for one</p>



<a name="221411657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411657">(Jan 02 2021 at 18:41)</a>:</h4>
<p>Python startup can be slow on slow systems.</p>



<a name="221411661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411661">(Jan 02 2021 at 18:41)</a>:</h4>
<p>Several seconds, not a tenth of a second.</p>



<a name="221411665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411665">(Jan 02 2021 at 18:41)</a>:</h4>
<p>on systems that slow building rust will be intolerably slow anyway</p>



<a name="221411668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411668">(Jan 02 2021 at 18:41)</a>:</h4>
<p>like, days</p>



<a name="221411710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411710">(Jan 02 2021 at 18:42)</a>:</h4>
<p>True. In any case, thanks for working on this.</p>



<a name="221411742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411742">(Jan 02 2021 at 18:43)</a>:</h4>
<p>I would generally agree with you <span class="user-mention" data-user-id="232545">@Joshua Nelson</span> but I just want to mention that process startup and filesystem operations are both really slow on Windows in comparison to Linux. Even on a fast pc.</p>



<a name="221411801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411801">(Jan 02 2021 at 18:44)</a>:</h4>
<p>hmm, ok</p>



<a name="221411802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411802">(Jan 02 2021 at 18:44)</a>:</h4>
<p>would be interested to see some numbers for that</p>



<a name="221411806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411806">(Jan 02 2021 at 18:44)</a>:</h4>
<p>Let me go test it :)</p>



<a name="221411815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411815">(Jan 02 2021 at 18:45)</a>:</h4>
<p>I don't have the beefiest Windows box, but it's also not unreasonably slow.</p>



<a name="221411867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411867">(Jan 02 2021 at 18:46)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> your execvp script is passing arguments directly to the python interpreter somehow <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> <code>x.py -h</code> now gives</p>
<div class="codehilite"><pre><span></span><code>usage: ./x.py [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
-b     : issue warnings about str(bytes_instance), str(bytearray_instance)
         and comparing bytes/bytearray with str. (-bb: issue errors)
-B     : don&#39;t write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x
...
</code></pre></div>



<a name="221411873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411873">(Jan 02 2021 at 18:46)</a>:</h4>
<p>Oh, oops.</p>



<a name="221411881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411881">(Jan 02 2021 at 18:47)</a>:</h4>
<p>["python3"] + sys.args</p>



<a name="221411884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411884">(Jan 02 2021 at 18:47)</a>:</h4>
<p><del>sys.argv is <code>['./x.py', '-h']</code> so that's not the issue</del> never mind I don't understand how argv works</p>



<a name="221411901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411901">(Jan 02 2021 at 18:47)</a>:</h4>
<p>It's executing python3 and making python think it's called x.py. :)</p>



<a name="221411946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221411946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221411946">(Jan 02 2021 at 18:48)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/80625">https://github.com/rust-lang/rust/pull/80625</a></p>



<a name="221412046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412046">(Jan 02 2021 at 18:51)</a>:</h4>
<p>I'm seeing <code>0.08 - 0.11</code> seconds consistently on my Windows box (Windows 10 w/ Windows Defender no other AV, 16 gb RAM i7 4790k, ssd)</p>



<a name="221412052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412052">(Jan 02 2021 at 18:51)</a>:</h4>
<p>Probably not enough to worry about</p>



<a name="221412223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412223">(Jan 02 2021 at 18:55)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> since you're on windows anyway, can you tell me if this works in powershell and cmd.exe?</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/x.py b/x.py</span>
<span class="gh">index ab02072b04f..3a5382ee937 100755</span>
<span class="gd">--- a/x.py</span>
<span class="gi">+++ b/x.py</span>
<span class="gu">@@ -1,4 +1,20 @@</span>
<span class="gd">-#!/usr/bin/env python</span>
<span class="gi">+#!/bin/sh</span>
<span class="gi">+</span>
<span class="gi">+# The beginning of this script is both valid shell and valid python, such that</span>
<span class="gi">+# the script starts with the shell and is reexecuted with the right python.</span>
<span class="gi">+# This works because shells only execute a line at a time.</span>
<span class="gi">+# Thanks to `./mach` from servo for the idea!</span>
<span class="gi">+''':' &amp;&amp; {</span>
<span class="gi">+exists() { command -v "$1" &gt;/dev/null 2&gt;&amp;1; }</span>
<span class="gi">+if exists python3; then</span>
<span class="gi">+    exec python3 "$0" "$@"</span>
<span class="gi">+elif exists python; then</span>
<span class="gi">+    exec python "$0" "$@"</span>
<span class="gi">+else</span>
<span class="gi">+    exec python2 "$0" "$@"</span>
<span class="gi">+fi</span>
<span class="gi">+}</span>
<span class="gi">+'''</span>
</code></pre></div>



<a name="221412224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412224">(Jan 02 2021 at 18:55)</a>:</h4>
<p>Just as a random data point: my 2016 mbp does the same thing consistently in <code>0.03</code> seconds and my Linux box does it in <code>0.01</code> seconds.</p>



<a name="221412296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412296">(Jan 02 2021 at 18:57)</a>:</h4>
<p>it does work in fish, so there's that at least</p>



<a name="221412360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412360">(Jan 02 2021 at 18:59)</a>:</h4>
<p>(<code>git apply</code> will apply that diff for you automatically, just copy paste it in)</p>



<a name="221412870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412870">(Jan 02 2021 at 19:10)</a>:</h4>
<p>Sorry, I'm not signed into Zulip or GH on that pc so it took a little while to get setup</p>



<a name="221412880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412880">(Jan 02 2021 at 19:11)</a>:</h4>
<p>It worked fine in cmd.exe (using <code>python x.py</code>)</p>



<a name="221412885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412885">(Jan 02 2021 at 19:11)</a>:</h4>
<p>I got a an error in Powershell but I think it's unrelated.</p>



<a name="221412886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412886">(Jan 02 2021 at 19:11)</a>:</h4>
<p>Oh interesting, do people not run ./x.py directly on windows?</p>



<a name="221412895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412895">(Jan 02 2021 at 19:11)</a>:</h4>
<p>Can you paste the powershell error?</p>



<a name="221412937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412937">(Jan 02 2021 at 19:12)</a>:</h4>
<p>It's related to paths on my filesystem because I usually use <code>bash</code> on windows not powershell or cmd</p>



<a name="221412945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412945">(Jan 02 2021 at 19:12)</a>:</h4>
<p>Hmm, ok.</p>



<a name="221412947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412947">(Jan 02 2021 at 19:12)</a>:</h4>
<p><code>x.py</code> was invoked though and it failed later than the changes I applied</p>



<a name="221412963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221412963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221412963">(Jan 02 2021 at 19:13)</a>:</h4>
<p>well this is exciting :D</p>



<a name="221413063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221413063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221413063">(Jan 02 2021 at 19:15)</a>:</h4>
<p>on linux running powershell natively ... appears to be broken, I can't even open the shell :( it was working yesterday</p>



<a name="221413893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221413893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221413893">(Jan 02 2021 at 19:35)</a>:</h4>
<p>I just tested running x.py directly, and added my results to the issue. In short, it doesn't work</p>



<a name="221413961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221413961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221413961">(Jan 02 2021 at 19:37)</a>:</h4>
<p><span class="user-mention" data-user-id="319144">@Rune Tynan</span> did <code>./x.py</code> work before? I'm confused whether people use ./x.py or <code>python x.py</code> on windows</p>



<a name="221414125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414125">(Jan 02 2021 at 19:40)</a>:</h4>
<p><code>x.py</code> works currently, it's what I use when working in powershell</p>



<a name="221414210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414210">(Jan 02 2021 at 19:42)</a>:</h4>
<p>Interestingly, <code>python x.py</code> still works, by <code>py x.py</code> does <em>not</em>, and that's something I'd consider significant breakage, as I use <code>py</code> more than <code>python</code>, because I can actually set the version of <code>py</code>.</p>



<a name="221414213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414213">(Jan 02 2021 at 19:42)</a>:</h4>
<p>Actually, apparently, <code>py -m x</code> works still. Fun</p>



<a name="221414214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414214">(Jan 02 2021 at 19:42)</a>:</h4>
<p>oh that's very strange</p>



<a name="221414216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414216">(Jan 02 2021 at 19:42)</a>:</h4>
<p>what does <code>py x.py</code> do?</p>



<a name="221414220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414220">(Jan 02 2021 at 19:42)</a>:</h4>
<p>(what error I mean)</p>



<a name="221414231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414231">(Jan 02 2021 at 19:43)</a>:</h4>
<p>what confuses me is that there was a hashbang before, it was /usr/bin/env - is the issue that /usr/bin exists but not /bin?</p>



<a name="221414238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414238">(Jan 02 2021 at 19:43)</a>:</h4>
<p>I can fix that by changing it to /usr/bin/env sh</p>



<a name="221414244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414244">(Jan 02 2021 at 19:43)</a>:</h4>
<p>Same error as running it without a program. I wonder if <code>py</code> actually sets the PATH so the correct version is active, then just does <code>filename.py</code>?</p>



<a name="221414255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414255">(Jan 02 2021 at 19:43)</a>:</h4>
<p><a href="/user_uploads/4715/JOkTUqj4MOt-vkfJ32R73WvB/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/JOkTUqj4MOt-vkfJ32R73WvB/image.png" title="image.png"><img src="/user_uploads/4715/JOkTUqj4MOt-vkfJ32R73WvB/image.png"></a></div>



<a name="221414300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414300">(Jan 02 2021 at 19:44)</a>:</h4>
<p><code>/usr/bin</code> also doesn't exist, but I wonder if it's special-cased?</p>



<a name="221414309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414309">(Jan 02 2021 at 19:44)</a>:</h4>
<p>yeah, try changing the hashbang and see if it fixes it</p>



<a name="221414334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414334">(Jan 02 2021 at 19:45)</a>:</h4>
<p><code>/usr/bin/env sh</code>:<br>
<a href="/user_uploads/4715/SXczkxMAMMfn8oVJEvfQsnUj/image.png">image.png</a> <br>
<code>/usr/bin/env python</code>:<br>
<a href="/user_uploads/4715/SCpK4ijhoqMRJMHdQ1Ag7NJo/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/SXczkxMAMMfn8oVJEvfQsnUj/image.png" title="image.png"><img src="/user_uploads/4715/SXczkxMAMMfn8oVJEvfQsnUj/image.png"></a></div><div class="message_inline_image"><a href="/user_uploads/4715/SCpK4ijhoqMRJMHdQ1Ag7NJo/image.png" title="image.png"><img src="/user_uploads/4715/SCpK4ijhoqMRJMHdQ1Ag7NJo/image.png"></a></div>



<a name="221414345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414345">(Jan 02 2021 at 19:45)</a>:</h4>
<p>wtf</p>



<a name="221414355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414355">(Jan 02 2021 at 19:45)</a>:</h4>
<p>is it literally special casing the exact string <code>/usr/bin/env python</code>?</p>



<a name="221414374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414374">(Jan 02 2021 at 19:46)</a>:</h4>
<p>I hate that so much</p>



<a name="221414395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414395">(Jan 02 2021 at 19:46)</a>:</h4>
<p>Wait, I think I know why this is all like it is</p>



<a name="221414416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414416">(Jan 02 2021 at 19:46)</a>:</h4>
<p>Running <code>x.py</code> is exactly equivalent to running <code>py x.py</code>. <code>py</code> special cases <em>specifically python shebangs</em>, because it expects a python file. Other ones, it tries to interpret, because it thinks they might actually point to a valid alternate interpreter</p>



<a name="221414427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414427">(Jan 02 2021 at 19:47)</a>:</h4>
<p>(That's a guess, to clarify, not absolute truth. But it matches observations)</p>



<a name="221414428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414428">(Jan 02 2021 at 19:47)</a>:</h4>
<p>ugh</p>



<a name="221414430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414430">(Jan 02 2021 at 19:47)</a>:</h4>
<p>ok I'll revert that commit then</p>



<a name="221414435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414435">(Jan 02 2021 at 19:48)</a>:</h4>
<p><code>python</code> doesn't special-case, because that's actually the interpreter exe, not a windows-shim to make python files behave like they do on linux</p>



<a name="221414491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414491">(Jan 02 2021 at 19:49)</a>:</h4>
<p>that's such a hack</p>



<a name="221414503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414503">(Jan 02 2021 at 19:49)</a>:</h4>
<p>Yep. A lot of command-line stuff on windows feels like 'A hack because we wanted it to behave like linux'</p>



<a name="221414511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414511">(Jan 02 2021 at 19:50)</a>:</h4>
<p>For windows, using <code>py -3</code> should get you the same behavior as <code>python3</code> on linux, if you want to make the pure-python re-exec work</p>



<a name="221414562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414562">(Jan 02 2021 at 19:50)</a>:</h4>
<p>Every time I think a language has finally solved the problem of cross platform scripting, something has to mess it up :(</p>



<a name="221414571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414571">(Jan 02 2021 at 19:50)</a>:</h4>
<p>well it doesn't matter on windows because download-ci-llvm doesn't work yet</p>



<a name="221414578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414578">(Jan 02 2021 at 19:50)</a>:</h4>
<p>but eventually it will matter I guess - does <code>py</code> default to python 2?</p>



<a name="221414600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414600">(Jan 02 2021 at 19:51)</a>:</h4>
<p>Mine defaults to 3.9. I think it defaults to whatever comes first in your PATH, which unless you change it by hand, is the one you installed first?</p>



<a name="221414604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414604">(Jan 02 2021 at 19:51)</a>:</h4>
<p>that seems fine then, certainly not worth messing with</p>



<a name="221414611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414611">(Jan 02 2021 at 19:51)</a>:</h4>
<p>Makes sense</p>



<a name="221414657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414657">(Jan 02 2021 at 19:52)</a>:</h4>
<p>Sorry to ruin the shebang magic, I really like it in theory :P</p>



<a name="221414661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414661">(Jan 02 2021 at 19:52)</a>:</h4>
<p>nah you're good, if it breaks things it's not worth it</p>



<a name="221414677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414677">(Jan 02 2021 at 19:53)</a>:</h4>
<p>What's the rationale for using python in  <code>x.py</code>? I assumed it was for the cross platform thing</p>



<a name="221414682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414682">(Jan 02 2021 at 19:53)</a>:</h4>
<p><span class="user-mention" data-user-id="271719">@Mario Carneiro</span> <a href="https://github.com/rust-lang/rust/issues/71818#issuecomment-623291126">https://github.com/rust-lang/rust/issues/71818#issuecomment-623291126</a></p>



<a name="221414729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414729">(Jan 02 2021 at 19:54)</a>:</h4>
<p>I wonder if a <code>/usr/bin/env python[2|3]</code> shebang will make <code>py</code> default to that version</p>



<a name="221414737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414737">(Jan 02 2021 at 19:55)</a>:</h4>
<p>That would allow the shebang to work right as long as you're not explicitly invoking the interpreter, right?</p>



<a name="221414788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414788">(Jan 02 2021 at 19:56)</a>:</h4>
<p><span class="user-mention" data-user-id="319144">@Rune Tynan</span> sure, but then that breaks bash on windows <a href="https://github.com/rust-lang/rust/pull/71841#issuecomment-623108800">https://github.com/rust-lang/rust/pull/71841#issuecomment-623108800</a></p>



<a name="221414793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414793">(Jan 02 2021 at 19:56)</a>:</h4>
<p>also explicitly invoking the interpreter is fine</p>



<a name="221414795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414795">(Jan 02 2021 at 19:56)</a>:</h4>
<p>it's only when something tries to invoke /usr/bin/env python and doesn't find it that it's an issue</p>



<a name="221414799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414799">(Jan 02 2021 at 19:57)</a>:</h4>
<p>Makes sense</p>



<a name="221414810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414810">(Jan 02 2021 at 19:57)</a>:</h4>
<p>Love how everything but exactly what it is breaks <em>something</em></p>



<a name="221414819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414819">(Jan 02 2021 at 19:57)</a>:</h4>
<p>oh no exactly what it is breaks things too lol</p>



<a name="221414820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414820">(Jan 02 2021 at 19:57)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/71818">https://github.com/rust-lang/rust/issues/71818</a></p>



<a name="221414859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414859">(Jan 02 2021 at 19:58)</a>:</h4>
<p>truly astounding how badly python managed to mess this up</p>



<a name="221414876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221414876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221414876">(Jan 02 2021 at 19:59)</a>:</h4>
<p>I love the language, but the way they handled the 2 -&gt; 3 switch was not what I'd call ideal :P</p>



<a name="221420785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221420785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221420785">(Jan 02 2021 at 22:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/221412886">said</a>:</p>
<blockquote>
<p>Oh interesting, do people not run ./x.py directly on windows?</p>
</blockquote>
<p>That doesn't work for me, at least.  So it's <code>python x.py test</code>.</p>
<p>(But I almost always just get it by hitting up in the terminal, so I've never cared about that.)</p>



<a name="221987325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221987325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221987325">(Jan 07 2021 at 19:15)</a>:</h4>
<p><span class="user-mention" data-user-id="319144">@Rune Tynan</span> do you have time to see whether reexecuting with <code>py -3</code> works on windows? <a href="https://github.com/rust-lang/rust/pull/80625">https://github.com/rust-lang/rust/pull/80625</a></p>



<a name="221997729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221997729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221997729">(Jan 07 2021 at 20:40)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Yeah, I can do that. I'll try the PR and see if it work</p>



<a name="221998320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998320">(Jan 07 2021 at 20:46)</a>:</h4>
<p>The attempt to run <code>python3</code> is. Redirecting me to the windows store. I really hate that</p>



<a name="221998336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998336">(Jan 07 2021 at 20:46)</a>:</h4>
<p>oh oof</p>



<a name="221998365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998365">(Jan 07 2021 at 20:46)</a>:</h4>
<p>whose bright idea was that lol</p>



<a name="221998667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998667">(Jan 07 2021 at 20:49)</a>:</h4>
<p><span class="user-mention" data-user-id="319144">@Rune Tynan</span> how are you running it? as <code>./x.py</code>?</p>



<a name="221998688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998688">(Jan 07 2021 at 20:49)</a>:</h4>
<p>well I guess it doesn't matter any more since it re-executes itself</p>



<a name="221998702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998702">(Jan 07 2021 at 20:49)</a>:</h4>
<p><code>py -2 x.py</code>. My default execution runs it as 3.X</p>



<a name="221998705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998705">(Jan 07 2021 at 20:49)</a>:</h4>
<p>what's launching the windows store? that's such an awful thing to do</p>



<a name="221998793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998793">(Jan 07 2021 at 20:50)</a>:</h4>
<p>Technically, when it re-executes, it just prints out a message telling me to go to the store, when I run <code>python3</code> myself it actually opens it</p>



<a name="221998809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998809">(Jan 07 2021 at 20:50)</a>:</h4>
<p>wtf</p>



<a name="221998823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998823">(Jan 07 2021 at 20:50)</a>:</h4>
<p>It seems to be an 'execution alias' defined (automatically?) by windows</p>



<a name="221998874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998874">(Jan 07 2021 at 20:51)</a>:</h4>
<p>Overriden by something of the same name being in the path, thus why it doesn't happen if I run <code>python</code>, only <code>python3</code></p>



<a name="221998903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998903">(Jan 07 2021 at 20:51)</a>:</h4>
<p>ugh</p>



<a name="221998916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998916">(Jan 07 2021 at 20:51)</a>:</h4>
<p>maybe I should check if <code>python3</code> is executable after all</p>



<a name="221998925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221998925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221998925">(Jan 07 2021 at 20:51)</a>:</h4>
<p>that seems liable to break on windows though</p>



<a name="221999019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999019">(Jan 07 2021 at 20:52)</a>:</h4>
<p>I think</p>
<div class="codehilite"><pre><span></span><code>if sys.platform == &quot;win32&quot;:
    sys.execvp(...)
else:
    sys.execvp(...)
</code></pre></div>
<p>Is your best bet</p>



<a name="221999063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999063">(Jan 07 2021 at 20:52)</a>:</h4>
<p>well it's even worse, you could really have python3 installed on windows and it would work fine</p>



<a name="221999076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999076">(Jan 07 2021 at 20:52)</a>:</h4>
<p>it's only when you don't have it installed that it breaks</p>



<a name="221999085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999085">(Jan 07 2021 at 20:52)</a>:</h4>
<p>True</p>



<a name="221999132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999132">(Jan 07 2021 at 20:53)</a>:</h4>
<p>I mean, I have python 3.7-3.9 all installed, they don't come with a <code>python3.exe</code> with the windows installer</p>



<a name="221999256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999256">(Jan 07 2021 at 20:54)</a>:</h4>
<p>I'll try <code>py -3</code> first and fall back to python3 otherwise maybe</p>



<a name="221999297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999297">(Jan 07 2021 at 20:54)</a>:</h4>
<p><span class="user-mention" data-user-id="319144">@Rune Tynan</span> would you be interested in writing that up? you'll be able to test more quickly than I can</p>



<a name="221999305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999305">(Jan 07 2021 at 20:54)</a>:</h4>
<p>That might work. Cross-platform pain, yay</p>



<a name="221999359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999359">(Jan 07 2021 at 20:54)</a>:</h4>
<p>And yeah, just swap the position of the execvp calls basically?</p>



<a name="221999371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999371">(Jan 07 2021 at 20:54)</a>:</h4>
<p><del>this would work fine if windows weren't cursed</del></p>



<a name="221999378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999378">(Jan 07 2021 at 20:54)</a>:</h4>
<p>yeah</p>



<a name="221999512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999512">(Jan 07 2021 at 20:55)</a>:</h4>
<p><del>Every time I touch windows-specific stuff, I take psychic damage</del></p>



<a name="221999906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999906">(Jan 07 2021 at 20:59)</a>:</h4>
<p>Swapping the positions of the execs seems to have worked. Retry code runs, succeeds, we get a python 3 instance, it runs and works</p>



<a name="221999934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999934">(Jan 07 2021 at 20:59)</a>:</h4>
<p>hmm, ok</p>



<a name="221999951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/221999951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#221999951">(Jan 07 2021 at 20:59)</a>:</h4>
<p>let me give you push access to my fork</p>



<a name="222000215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222000215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222000215">(Jan 07 2021 at 21:01)</a>:</h4>
<p>you should have gotten an invite</p>



<a name="222000989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222000989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222000989">(Jan 07 2021 at 21:07)</a>:</h4>
<p>Pushed changes + comment on why <code>py -3</code> is done first</p>



<a name="222030463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222030463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aru Sahni <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222030463">(Jan 08 2021 at 03:24)</a>:</h4>
<p>Out of curiosity, what does the windows version return for something like <code>python3 --version</code> if the alias is present?</p>



<a name="222030954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222030954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222030954">(Jan 08 2021 at 03:35)</a>:</h4>
<p><a href="/user_uploads/4715/9wkYuH7Y6gLai5w11943VlLs/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/9wkYuH7Y6gLai5w11943VlLs/image.png" title="image.png"><img src="/user_uploads/4715/9wkYuH7Y6gLai5w11943VlLs/image.png"></a></div>



<a name="222031180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222031180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> CraftSpider <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222031180">(Jan 08 2021 at 03:41)</a>:</h4>
<p>The same message is given no matter what flags, except for no flags which opens the store. I suspect its logic is just 'has any arguments'</p>



<a name="222032335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222032335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222032335">(Jan 08 2021 at 04:07)</a>:</h4>
<p>It is possible to tell if the alias points to a real <code>python.exe</code> or to the store but doing so is probably more involved then is necessary if a simpler workaround is sufficient.</p>
<p>This would be less of a problem if the official Python installer methods were more consistent with each other. Currently the official Installer doesn't set a <code>python3.exe</code> alias and instead has a custom <code>py.exe</code> to find the right binary. Whereas the official Store application does set a <code>python3.exe</code> alias but doesn't have <code>py.exe</code>.</p>
<p>I'd guess the root problem is that Python itself only has <code>python.exe</code> so it's up to whoever creates the distributable packages to come up with their own way of doing things.</p>



<a name="222055083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222055083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222055083">(Jan 08 2021 at 10:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="319144">Rune Tynan</span> <a href="#narrow/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F/near/222031180">said</a>:</p>
<blockquote>
<p>The same message is given no matter what flags, except for no flags which opens the store. I suspect its logic is just 'has any arguments'</p>
</blockquote>
<p>what's the exit code for this case?</p>



<a name="222070838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222070838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222070838">(Jan 08 2021 at 13:19)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> it doesn't matter - any exit code could be a normal exit code from rustbuild, x.py can't tell the difference</p>



<a name="222071555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222071555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222071555">(Jan 08 2021 at 13:27)</a>:</h4>
<p>I meant for <code>python3 --version</code> -- we could consider python3 to be installed only if that exits with 0? this is assuming that the windows store shim exits with non-0</p>



<a name="222071647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222071647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222071647">(Jan 08 2021 at 13:28)</a>:</h4>
<p>so I imagine <code>x.py</code> doing <code>python3 --version</code> to detect python 3 (instead of just trying to re-exec as <code>python3 x.py</code>)</p>



<a name="222071663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222071663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222071663">(Jan 08 2021 at 13:28)</a>:</h4>
<p>Hmm, I see, that could work</p>



<a name="222071677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222071677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222071677">(Jan 08 2021 at 13:28)</a>:</h4>
<p>I think I'd prefer to see if anyone actually hits this in practice though</p>



<a name="222071729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222071729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222071729">(Jan 08 2021 at 13:29)</a>:</h4>
<p>sure, I guess "make sure you use python 3" (so the re-exec path isn't it) will work for basically everyone</p>



<a name="222071772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222071772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222071772">(Jan 08 2021 at 13:29)</a>:</h4>
<p>also, FWIW, the download-ci-llvm error only appears once -- after doing <code>python3 x.py ...</code> once, future <code>x.py</code> invocations work fine with python 2 (presumably because the archive got already extracted)</p>



<a name="222071872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/x.py%20%2B%20download-ci-llvm%20-%3E%20explicit%20python3%20needed%3F/near/222071872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/x.2Epy.20.2B.20download-ci-llvm.20-.3E.20explicit.20python3.20needed.3F.html#222071872">(Jan 08 2021 at 13:30)</a>:</h4>
<p>That sounds right, yeah. It will break again the next time LLVM is updated but it should work with python2 until that point</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>